using System;

namespace roster.UI
{
    public class CreateRosterController : ICreateRosterController
    {
        private readonly ICreateRosterView m_CreateRosterView;
        public event Action<string> CreateRoster;

        public CreateRosterController(ICreateRosterView createRosterView)
        {
            m_CreateRosterView = createRosterView;
            m_CreateRosterView.CreateRaid += m_CreateRosterView_CreateRaid;
        }

        private void m_CreateRosterView_CreateRaid()
        {
            CreateRoster(m_CreateRosterView.RosterName);
        }

        #region ICreateRosterController Members

        public void Display()
        {
            m_CreateRosterView.Display();
        }

        #endregion
    }
}